/******************************************************************************
 *  _____     _____
 *  \  __\    \  __\
 *   \ \_\\    \ \_\\
 *    \  __\SS  \  __\roject
 *     \_\       \_\
 *
 * Mateusz Maciąg, Rafał Urbański
 * Komputerowe Systemy Sterowania
 *****************************************************************************/

#ifndef ARXCONFIGURATOR_H
#define ARXCONFIGURATOR_H

#include "SimInterface/IDiscreteObject.h"

#include <QGroupBox>
#include <vector>

namespace Ui {
    class ARXConfigurator;
}

class QListWidgetItem;

/**
    Widget do konfiguracji modelu ARX.
*/
class ARXConfigurator : public QGroupBox
{
    Q_OBJECT

public:
    explicit ARXConfigurator(QWidget *parent = 0);
    ~ARXConfigurator();

    /**
        Wiąże obiekt ARX z tym widgetem
    */
    void attachARXObject(RafMat::SimInterface::IDiscreteObjectSPtr arxObject);

private slots:
    void on_btnAdd_clicked();
    void on_paramsList_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);
    void on_btnRemove_clicked();
    void on_btnApply_clicked();

private:
    void updateARXList(const std::vector<RafMat::SimInterface::IConfigurableSPtr>& arxParams);
    void insertParametersConfiguration(RafMat::SimInterface::IConfigurableSPtr conf);

    RafMat::SimInterface::IConfigurableSPtr obtainConfFromListItem(QListWidgetItem *item);

    RafMat::SimInterface::IDiscreteObjectSPtr m_arxObject;
    Ui::ARXConfigurator *ui;
};

#endif // ARXCONFIGURATOR_H
